/* eslint-disable eol-last */
/* eslint-disable indent */
'use strict';
module.exports = app => {
    const { router, controller } = app;
    // api
    router.post('/api/user/register', app.middleware.validate(), controller.user.register);

    // 用户是否存在路由 isExist
    router.post('/api/user/isExist', controller.user.isExist);
    // 登陆
    router.post('/api/user/login', controller.user.login);
    // 删除当前用户
    router.delete('/api/user/delete', app.middleware.loginChecks.loginCheck, controller.user.deleteCurrentUser);
    //  更改用户信息  保证用户登录状态，更改信息的格式校验
    router.post('/api/user/changeUserInfo', app.middleware.loginChecks.loginCheck, app.middleware.validate(), controller.user.changeUserInfo);
    // eslint-disable-next-line eol-last
    // 更改密码
    router.post('/api/user/changePassword', app.middleware.loginChecks.loginCheck, app.middleware.validate(), controller.user.changePassword);

    router.post('/api/user/square', app.middleware.loginChecks.loginCheck, controller.square.square);
    // 注销登陆
    router.post('/api/user/logout', app.middleware.loginChecks.loginCheck, controller.user.logout);
    // 获取@人列表
    router.get('/api/user/getAtList', app.middleware.loginChecks.loginCheck, controller.user.getAtList);

};